
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/admin/layui-v2.4.5/layui/css/layui.css"  media="all">
    <link rel="stylesheet" href="/admin/css/admin.css"  media="all">
    <link rel="stylesheet" href="/admin/css/template.css"  media="all">
</head>
<body>
<script src="/admin/layui-v2.4.5/layui/layui.js" charset="utf-8"></script>


<div class="layui-fluid layadmin-maillist-fluid">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">患者姓名</label>
                <div class="layui-input-block">
                    <input id="pat_search_name" type="text" name="pat_search_name" placeholder="请输入" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-inline">
                <button id="button-name" class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="LAY-pat-back-search2">
                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                </button>
            </div>

        </div>
    </form>

    <div class="layui-row layui-col-space15 "id="mianban" >

    </div>
</div>
<script>
    layui.use('layer', function() {
        var $ = layui.$ //由于layer弹层依赖jQuery，所以可以直接得到
            ,layer = layui.layer;
        $(document).ready(function () {
            $.ajax({
                url: '/hospital/allMedPat',
                dataType: 'json',
                type: 'get',
                contentType: "application/json; charset=utf-8",
                success: function (data) {
                    $.each(data.data, function (index, item) {
                        var sex;
                        if (item.pat_sex=="1") {
                            sex = "男"
                        } if (item.pat_sex=="0")  sex="女"

                        if (item.status == 3) {
                            $('#mianban').append("<div class=\"layui-col-md4 layui-col-sm6\">\n" +
                                "                    <div class=\"layadmin-contact-box\" >\n" +
                                "                    <div class=\"layui-col-md4 layui-col-sm6\">\n" +
                                "                    <a href=\"javascript:;\">\n" +
                                "                    <div class=\"layadmin-text-center\">\n" +
                                "                    <img src=\"/admin/extend/image/1.jpg\">\n" +
                                "                    <div class=\"layadmin-maillist-img layadmin-font-blod\">\n" +
                                "                    <span class=\"layui-badge layui-bg-green\">已收费</span>\n" +
                                "                    </div>\n" +
                                "                    </div>\n" +
                                "                    </a>\n" +
                                "                    </div>\n" +
                                "                    <div class=\"layui-col-md8 layadmin-padding-left20 layui-col-sm6\">\n" +
                                "                    <a href=\"javascript:;\">\n" +
                                "                    <h3 class=\"layadmin-title\">\n" +
                                "                    <strong id='patName'>" + item.pat_name + "</strong>\n" +
                                "                    </h3>\n" +
                                "                    </a>\n" +
                                "                    <p class=\"layadmin-textimg\">\n" +
                                "                    <i class=\"layui-icon layui-icon-user\"></i>\n" +
                                sex +
                                "                </p>\n" +
                                "\n" +
                                "                <div class=\"layadmin-address\">\n" +
                                "                    <a href=\"javascript:;\">\n" +
                                "                    <br>\n" +
                                "                    <addr title=\"phone\"><i class=\"layui-icon layui-icon-cellphone\"></i>\n" +
                                "                Tel:</addr>" + item.contract + "</a>\n" +
                                "                </div>\n" +
                                "                </div>\n" +
                                "                </div>\n" +
                                "                </div>");
                        }
                    });
                }

            })
        })
        $(document).on('click','#hahaha',function(){
            $.ajax({
                url: "/hospital/checkPatStatue",
                type: "POST",
                dataType: "json",
                async:false,
                contentType: "application/json; charset=utf-8",
                data:JSON.stringify({
                    "key":quiz2}),
                success: function (e) {
                    $('#mianban').empty();
                    // layer.msg(e);
                },
                error: function (e) {
                    layer.msg(e);
                }
            })})

    });

    var quiz2;
    layui.use('form', function () {
        var $=layui.$
        var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功

        form.on('select',function(data){
            // form.render();
            quiz2=data.value;
            console.log(quiz2);


        })

        // form.render();
    });




</script>


</div>




</body>
</html>
